package top.stmo.stmoBlog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import top.stmo.stmoBlog.dao.pojo.Navigation;
import top.stmo.stmoBlog.service.AboutService;
import top.stmo.stmoBlog.service.NavigationService;

import java.util.List;

@Controller
public class NavigationController {

    @Autowired
    private NavigationService navigationService;

    @GetMapping("navigation")
    public String navigation(Model model) {
        List<Navigation> navigationList = navigationService.findAllNavigation();
        String bookHtml = navigationService.findBookHtml();
        model.addAttribute("bookHtml",bookHtml);
        model.addAttribute("navigationList",navigationList);
        return "navigation";
    }


}
